Skip to content

feat(api): support /v1/convert/source/batch endpoint#545

Merged
edeandrea merged 1 commit into
docling-project:mainfrom
edeandrea:feat/batch-convert-endpoint
Jun 15, 2026
Merged

feat(api): support /v1/convert/source/batch endpoint#545
edeandrea merged 1 commit into
docling-project:mainfrom
edeandrea:feat/batch-convert-endpoint

Conversation

@edeandrea

Copy link
Copy Markdown
Contributor

Summary

  • Add batch document conversion support for the /v1/convert/source/batch endpoint introduced in docling-serve v1.22.0
  • New BatchConvertDocumentRequest model with sources, target, options, and optional webhook callbacks
  • New CallbackSpec class for webhook progress notifications
  • New convertSourceBatch() (sync) and convertSourceBatchAsync() (auto-polling) methods on DoclingServeConvertApi
  • Add maxNumElements field to S3Source for capping objects in batch mode
  • Fix ValidationError deserialization when server returns detail as a plain string instead of a list

Test plan

  • WireMock tests for batch convert with presigned URL target (sync)
  • WireMock tests for batch convert async with presigned URL target (full lifecycle: submit → poll → result)
  • WireMock tests for batch convert with S3 source and S3 target (verifies maxNumElements serialization)
  • WireMock tests for batch convert with webhook callbacks
  • Validation test for null request
  • ./gradlew build passes

Closes #540

Add batch document conversion support for the new endpoint introduced in
docling-serve v1.22.0. The batch endpoint processes multiple document
sources asynchronously, returning a task ID for tracking progress.

New types:
- BatchConvertDocumentRequest: request model with sources, target,
  options, and optional webhook callbacks
- CallbackSpec: webhook callback specification for progress notifications
- Jackson2/3ValidationErrorDetailListDeserializer: handle server 422
  responses where detail is a string instead of a list

API changes:
- DoclingServeConvertApi: add convertSourceBatch() and
  convertSourceBatchAsync() methods
- S3Source: add maxNumElements field for capping objects in batch mode
- ValidationError: fix deserialization when detail is a plain string

Closes docling-project#540

Signed-off-by: Eric Deandrea <edeandrea@gmail.com>
Signed-off-by: Eric Deandrea <eric.deandrea@ibm.com>
Copilot AI review requested due to automatic review settings June 15, 2026 19:56
@edeandrea edeandrea enabled auto-merge (squash) June 15, 2026 19:58

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR adds client + API-model support for docling-serve’s /v1/convert/source/batch endpoint (introduced in docling-serve v1.22.0), including request models for batch sources/targets/callbacks, client operations for submitting and auto-polling batch conversions, and improved ValidationError deserialization when the server returns detail as a plain string.

Changes:

  • Add BatchConvertDocumentRequest and CallbackSpec models and expose convertSourceBatch() / convertSourceBatchAsync() on DoclingServeConvertApi.
  • Implement batch convert operations in the serve client and add WireMock tests for sync/async batch flows (including S3 + callbacks).
  • Fix validation error parsing to accept detail as either a list of objects or a string (Jackson 2 + Jackson 3).

Reviewed changes

Copilot reviewed 11 out of 11 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
docs/src/doc/docs/whats-new.md Documents new batch conversion API support and related request types/fields.
docling-serve/docling-serve-client/src/test/java/ai/docling/serve/client/AbstractDoclingServeClientTests.java Adds WireMock tests for batch convert (sync/async), S3, callbacks, and null request validation.
docling-serve/docling-serve-client/src/main/java/ai/docling/serve/client/operations/ConvertOperations.java Implements /v1/convert/source/batch submission + auto-polling variant.
docling-serve/docling-serve-client/src/main/java/ai/docling/serve/client/DoclingServeClient.java Enhances 422 handling to surface validation detail messages in thrown exceptions.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/validation/ValidationError.java Adds Jackson2/Jackson3 custom deserializers for detail field.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/serialization/Jackson3ValidationErrorDetailListDeserializer.java New Jackson 3 deserializer for ValidationError.detail.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/serialization/Jackson2ValidationErrorDetailListDeserializer.java New Jackson 2 deserializer for ValidationError.detail.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/DoclingServeConvertApi.java Adds new batch convert API methods.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/request/source/S3Source.java Adds maxNumElements field for limiting objects read from S3 in batch mode.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/request/CallbackSpec.java New webhook callback specification model.
docling-serve/docling-serve-api/src/main/java/ai/docling/serve/api/convert/request/BatchConvertDocumentRequest.java New batch conversion request model (sources/target/options/callbacks).

@edeandrea edeandrea merged commit 91eb28a into docling-project:main Jun 15, 2026
26 checks passed
@edeandrea edeandrea deleted the feat/batch-convert-endpoint branch June 15, 2026 20:07
@github-actions

Copy link
Copy Markdown

:java_duke: JaCoCo coverage report

Overall Project 47.43% 🔴

There is no coverage information present for the Files changed

@github-actions

Copy link
Copy Markdown
TestsPassed ✅SkippedFailed
Gradle Test Results (all modules & JDKs)1476 ran1476 passed0 skipped0 failed
TestResult
No test annotations available

@github-actions

Copy link
Copy Markdown

HTML test reports are available as workflow artifacts (zipped HTML).

• Download: Artifacts for this run

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Support new /v1/convert/source/batch endpoint

2 participants